<?php
defined('_JEXEC') or die;
if (isDevMode()) {
   OCP\Util::addStyle('calendar', 'calendar');
   OCP\Util::addScript('calendar', 'calendar.list');
   OCP\Util::addStyle('calendar', 'calendar.common');
} else {
   OCP\Util::addStyle('static', 'calendar.list');
   OCP\Util::addScript('static', 'apps/calendar.list.min');
}
$resume_link = isset($_['resume_link']) ? $_['resume_link'] : null;
$round = $_['round'];
OCP\App::setActiveNavigationEntry('calendar_index');
?>
<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('calendar/js', 'l10n.php'));?>"></script>
<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('calendar/js', 'calendar.php'));?>"></script>
<div class="container inner_wrap" style="padding-top:30px;">    
      <div class="container" id="will_fixed">    
         <div class="row-fluid">
            <div class="span12">
               <div class="company_qes_fixed  large songti">面试反馈表-<?php if($round['round'] == 1){echo '初试';}else{echo '第'.$round['round'].'轮面试'; } ?></div>
            </div>
         </div>
      </div>
      
      <div class="row-fluid hr_oneconn_margin">
         <div class="span12 oneconn_box">
        <?php if(!empty($round)): ?>
           <form id="feedbackform">
            <div class="feedbackform">
               <ul class="feedbackform_name clearfix">
                  <li><b>应<i></i>聘<i></i>者：</b>
                  <?php if ( !empty($resume_link) ) { ?>
                     <a href="<?=$resume_link?>" target="_blank"><?=$round['jobseekername']?></a>
                  <?php } else { ?>
                     <a href="<?php echo OCP\Util::linkToRoute('resume_view', array('id' => $round['jobseekerid'], 'name' => $round['jobseekername']));?>" target="_blank"><?=$round['jobseekername']?></a>
                  <?php }?>
                  </li>
                  <li><b style="padding-left:10px;">应聘职位：</b>
                  <?php if ( !OC_User::isLoggedIn()) { ?>
                           <a href="<?php echo OC_Helper::linkToRoute("jobpos_view", array('id'=>$round['jobid'], 'job_title'=>$round['job_title']));?>" target="_blank"><?php echo strmaxwordlen($round['job_title'],22);?></a>
                  <?php } else { ?>
                           <a href="<?php echo OC_Helper::linkToRoute("jobpos_setup", array('id'=>$round['jobid'], 'job_title'=>$round['job_title']));?>" target="_blank"><?php echo strmaxwordlen($round['job_title'],22);?></a>
                  <?php } ?>
                  </li>
                  <li><b>面试时间：</b><span><?=JHtml::_('date', $round['startdate'], 'Y.m.d H:i') ?></span></li>
                  <li><b style="width:90px;"><em class="redstar">* </em>面<i></i>试<i></i>官：</b>
                     <input type="text" name="displayname" class="input-medium" placeholder="请填写您的姓名" value="<?=$_['displayname'] ?>" />
                     <input type="text" name="uid" value="<?=$_['interviewer'] ?>" style="display: none"/>
                     <span>(<?=$_['sharewith'] ?>)</span></li>
               </ul>

               <?php if (empty($_["notattended"])) {?>
                  <div class="jos_isabsent"><b>应聘者是否缺席：</b><i id='if_absent' style="cursor: pointer" class="<?php echo (empty($_["absent"]) ? 'absent_no': 'absent_yes'); ?>"></i></div>
                  <input type="hidden" id="absent" name="absent" value="<?=$_["absent"]; ?>">
               <?php } else { ?>
                  <input type="hidden" id="notattended" name="notattended" value="<?=$_["notattended"]; ?>">
               <?php }?>

               <div class="feedbackform_comdiv clearfix" <?php echo $_["absent"] || $_["notattended"] ? "style='display:none'": ''; ?> >
                  <b><em class="redstar">*</em> 建议：</b>
                  <?php if(!empty($_['suggestionlist'])): ?>
                  <?php foreach ($_['suggestionlist'] as $suggestionlist): ?>
                   <label class="radio inline">
                   <input type="radio" name="suggestion" value="<?=$suggestionlist['id'] ?>"/><?=$suggestionlist['suggestion'] ?>
                   </label>
                  <?php endforeach; ?>
                  <?php endif; ?>
               </div>
               
               <div class="feedbackform_comdiv clearfix" <?php echo $_["absent"] || $_["notattended"] ? "style='display:none'": ''; ?> >
                  <b><em class="redstar">*</em> 评语：</b>
                  <textarea placeholder="请在此输入您的评语" name="comment"></textarea>
               </div>

               <div class="feedbackform_table" <?php echo $_["absent"] || $_["notattended"] ? "style='display:none'": ''; ?> >
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                     <tr>
                     	<th width="24%" align="left";>评分项</th>
                        <th width="19%">优</th>
                        <th width="19%">良</th>
                        <th width="19%">中</th>
                        <th width="19%">差</th>
                     </tr>
                     <?php if(!empty($_['questionlist'])): ?>
                     <?php foreach ($_['questionlist'] as $questionlist): ?>
                     <tr>
                     	<td><?=$questionlist['question'] ?></td>
                        <td><input type="radio" name="<?=$questionlist['id'] ?>" value="4"/></td>
                        <td><input type="radio" name="<?=$questionlist['id'] ?>" value="3"/></td>
                        <td><input type="radio" name="<?=$questionlist['id'] ?>" value="2"/></td>
                        <td><input type="radio" name="<?=$questionlist['id'] ?>" value="1"/></td>
                     </tr>
                     <?php endforeach; ?>
                     <?php endif; ?>
                  </table>
               </div>
               
               <div id="error" style="text-align: center;"></div>
               <?php if (empty($_["notattended"])) {?>
                  <div class="ready_btn" style="margin-top:20px;"><a class="ppp_bluebtn" id="submitfeedback" href="javascript:;">提 交</a></div>
               <?php } else { ?>
                  <div class="ready_btn" style="margin-top:20px;"><a class="ppp_bluebtn" style="width: 150px" id="submitfeedback" href="javascript:;">我未参加面试，提交</a></div>
               <?php } ?>
               <input type="hidden" name="round" value="<?=$round['round'] ?>"/>
               <input type="hidden" name="objectid" value="<?=$round['objectid'] ?>"/>
               <input type="hidden" name="jobseekerid" value="<?=$round['jobseekerid'] ?>"/>
               <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
            </div>
           </form>
            <?php endif; ?>
         </div>
      </div>
   </div>
